home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 April: Mac OS SDK / Dev.CD Apr 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  3.8 KB  |  114 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CommResources.p
  3.  
  4.      Contains:    Communications Toolbox Resource Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1988-1998, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CommResources;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __COMMRESOURCES__}
  27. {$SETC __COMMRESOURCES__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CommResourcesIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __OSUTILS__}
  34. {$I OSUtils.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __CONDITIONALMACROS__}
  37. {$I ConditionalMacros.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45.  
  46. CONST
  47.                                                                 {     tool classes (also the tool file types)     }
  48.     classCM                        = 'cbnd';
  49.     classFT                        = 'fbnd';
  50.     classTM                        = 'tbnd';
  51.  
  52.                                                                 {     version of the Comm Resource Manager     }
  53.     curCRMVersion                = 2;                            {  constants general to the use of the Communications Resource Manager  }
  54.     crmType                        = 9;                            {  queue type     }
  55.     crmRecVersion                = 1;                            {  version of queue structure  }
  56.                                                                 {     error codes  }
  57.     crmGenericError                = -1;
  58.     crmNoErr                    = 0;
  59.  
  60. { data structures general to the use of the Communications Resource Manager }
  61.  
  62. TYPE
  63.     CRMErr                                = OSErr;
  64.     CRMRecPtr = ^CRMRec;
  65.     CRMRec = RECORD
  66.         qLink:                    QElemPtr;                                { reserved }
  67.         qType:                    INTEGER;                                { queue type -- ORD(crmType) = 9 }
  68.         crmVersion:                INTEGER;                                { version of queue element data structure }
  69.         crmPrivate:                LONGINT;                                { reserved }
  70.         crmReserved:            INTEGER;                                { reserved }
  71.         crmDeviceType:            LONGINT;                                { type of device, assigned by DTS }
  72.         crmDeviceID:            LONGINT;                                { device ID; assigned when CRMInstall is called }
  73.         crmAttributes:            LONGINT;                                { pointer to attribute block }
  74.         crmStatus:                LONGINT;                                { status variable - device specific }
  75.         crmRefCon:                LONGINT;                                { for device private use }
  76.     END;
  77.  
  78. FUNCTION InitCRM: CRMErr;
  79. FUNCTION CRMGetHeader: QHdrPtr;
  80. PROCEDURE CRMInstall(crmReqPtr: CRMRecPtr);
  81. FUNCTION CRMRemove(crmReqPtr: CRMRecPtr): OSErr;
  82. FUNCTION CRMSearch(crmReqPtr: CRMRecPtr): CRMRecPtr;
  83. FUNCTION CRMGetCRMVersion: INTEGER;
  84. FUNCTION CRMGetResource(theType: ResType; theID: INTEGER): Handle;
  85. FUNCTION CRMGet1Resource(theType: ResType; theID: INTEGER): Handle;
  86. FUNCTION CRMGetIndResource(theType: ResType; index: INTEGER): Handle;
  87. FUNCTION CRMGet1IndResource(theType: ResType; index: INTEGER): Handle;
  88. FUNCTION CRMGetNamedResource(theType: ResType; name: Str255): Handle;
  89. FUNCTION CRMGet1NamedResource(theType: ResType; name: Str255): Handle;
  90. PROCEDURE CRMReleaseResource(theHandle: Handle);
  91. FUNCTION CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  92. FUNCTION CRMGetToolNamedResource(procID: INTEGER; theType: ResType; name: Str255): Handle;
  93. PROCEDURE CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  94. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  95. FUNCTION CRMLocalToRealID(bundleType: ResType; toolID: INTEGER; theType: ResType; localID: INTEGER): INTEGER;
  96. FUNCTION CRMRealToLocalID(bundleType: ResType; toolID: INTEGER; theType: ResType; realID: INTEGER): INTEGER;
  97. FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  98. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  99. FUNCTION CRMIsDriverOpen(driverName: Str255): BOOLEAN;
  100. FUNCTION CRMParseCAPSResource(theHandle: Handle; selector: ResType; VAR value: UInt32): CRMErr;
  101. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  102. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  103.  
  104. {$ALIGN RESET}
  105. {$POP}
  106.  
  107. {$SETC UsingIncludes := CommResourcesIncludes}
  108.  
  109. {$ENDC} {__COMMRESOURCES__}
  110.  
  111. {$IFC NOT UsingIncludes}
  112.  END.
  113. {$ENDC}
  114.